<template>
  <view class="container">
    <nav-bar title="我的公寓" :showBack="true"></nav-bar>
    
    <view class="content">
      <!-- 已认证公寓卡片 -->
      <view class="apartment-card">
        <view class="card-header">
          <image class="apartment-logo" src="/static/head.png" mode="aspectFill"></image>
          <view class="apartment-info">
            <text class="apartment-name">逸嘉公寓</text>
            <text class="apartment-type">鹏(出房)</text>
          </view>
          <view class="login-status">
            <text class="status-text">当前登录</text>
          </view>
        </view>
        <view class="card-footer">
          <text class="verified-tag">已认证</text>
        </view>
      </view>
      
      <!-- 添加公寓按钮 -->
      <view class="add-apartment" @click="navigateTo('/pages/account/apartment')">
        <view class="add-icon">
          <uni-icons type="plus" size="24" color="#1890ff"></uni-icons>
        </view>
        <text class="add-text">添加公寓</text>
      </view>
    </view>
  </view>
</template>

<script>
import NavBar from '@/components/nav-bar/index.vue'

export default {
  components: {
    NavBar
  },
  data() {
    return {}
  },
  methods: {
    navigateTo(url) {
      uni.navigateTo({
        url
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  min-height: 100vh;
  background-color: #f7f8fa;
}

.content {
  padding: 24rpx 32rpx;
}

.apartment-card {
  background-color: #ffffff;
  border-radius: 16rpx;
  padding: 32rpx;
  margin-bottom: 24rpx;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  
  .card-header {
    display: flex;
    align-items: center;
    margin-bottom: 24rpx;
    
    .apartment-logo {
      width: 88rpx;
      height: 88rpx;
      border-radius: 50%;
      margin-right: 24rpx;
      border: 2rpx solid #f0f0f0;
    }
    
    .apartment-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      
      .apartment-name {
        font-size: 34rpx;
        font-weight: 600;
        color: #333333;
        margin-bottom: 12rpx;
        line-height: 1.4;
      }
      
      .apartment-type {
        font-size: 26rpx;
        color: #666666;
        line-height: 1.2;
      }
    }
    
    .login-status {
      .status-text {
        font-size: 26rpx;
        color: #1890ff;
        font-weight: 500;
      }
    }
  }
  
  .card-footer {
    .verified-tag {
      display: inline-block;
      padding: 6rpx 16rpx;
      background-color: #e6f7ff;
      color: #1890ff;
      font-size: 24rpx;
      border-radius: 6rpx;
      font-weight: 500;
    }
  }
}

.add-apartment {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border-radius: 16rpx;
  padding: 40rpx;
  margin-bottom: 24rpx;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  
  &:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .add-icon {
    margin-right: 16rpx;
  }
  
  .add-text {
    font-size: 30rpx;
    color: #1890ff;
    font-weight: 500;
  }
}
</style>